from launch import LaunchDescription
from launch_ros.actions import Node
from launch.actions import ExecuteProcess

def generate_launch_description():
    return LaunchDescription([
        # 启动Gazebo
        ExecuteProcess(
            cmd=['gazebo', '--verbose', '-s', 'libgazebo_ros_init.so'],
            output='screen'
        ),

        # 生成机器人模型
        Node(
            package='gazebo_ros',
            executable='spawn_entity.py',
            arguments=['-entity', 'turtlebot4', '-topic', 'robot_description'],
            output='screen'
        ),

        # 启动路径控制器
        Node(
            package='loop_control_cpp',
            executable='path_controller',
            output='screen'
        )
    ])